package com.atjava.webspider.util;

import java.awt.Component;

import javax.swing.JOptionPane;

public class DialogUtil {

	public static void showError(Component parent,String str){
		JOptionPane.showMessageDialog
		(parent, str, "系统错误", JOptionPane.ERROR_MESSAGE);
	}
	
	public static boolean confirmMessage(Component parent,String str){
		int result = JOptionPane.showConfirmDialog
		(parent, str,  "系统提示",JOptionPane.OK_CANCEL_OPTION ,JOptionPane.QUESTION_MESSAGE);
		return result == JOptionPane.YES_OPTION;
	}
	
	public static void showWarning(Component parent,String str){
		JOptionPane.showMessageDialog
		(parent, str, "系统警告", JOptionPane.WARNING_MESSAGE);
	}
	
	public static void showMessage(Component parent,String str){
		JOptionPane.showMessageDialog
		(parent, str, "系统信息", JOptionPane.INFORMATION_MESSAGE);
	}
	
}
